<?php

namespace App\Service;

use App\Models\Base\ChannelList;
use Illuminate\Support\Facades\DB;

/**
 * 游戏平台逻辑.
 */
class GamePlatformService
{
    /**
     * [getPlatform 获取游戏平台数据].
     *
     * @Author   王文凡
     * @DateTime 2018-02-28
     *
     * @version  1.0
     *
     * @param int $id [平台ID]
     *
     * @return object
     */
    public function getPlatform($id = 0)
    {
        if ($id) {
            $platform_data = DB::table('channel_list')->where('id', $id)->first();
        } else {
            $platform_data = ChannelList::get();
        }

        return $platform_data;
    }
}
